import http from "@/utils/request";

/**
 * 查询部门列表
 * @returns
 */
// export async function getDepartmentList(data) {
//   return await http.get("/api/department/list", data)
// }

export default {
  /**
   * 查询部门列表
   * @param {Object} params
   */
  async getDepartmentList(params) {
    return http.get("/api/department/list", params);
  },
  /**
   * 获取所属部门列表
   * @param {Object} params
   */
  async getParentTreeList() {
    return http.get("/api/department/parent/list");
  },
  /**
   * 添加部门
   * @returns
   */
  async addDept(params) {
    return await http.post("/api/department/add", params);
  },
   /**
   * 编辑部门
   * @returns
   */
   async updateDept(params) {
    return await http.put("/api/department/update", params);
  },

     /**
   * 检查部门下是否有子部门
   * @returns
   */
     async checkDepartment(params) {
      return await http.getRestApi("/api/department/check", params);
    },
    
     /**
   * 删除部门
   * @returns
   */
     async deleteById(params) {
      return await http.delete("/api/department/delete", params);
    },
};
